[projmgr] Adjust relative paths in misc nodes#2501
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes conversion output correctness by ensuring relative paths embedded in misc option strings (solution/project/layer level) are rewritten so they remain valid in the generated *.cbuild.yml files.
Changes:
- Added
ProjMgrUtils::AdjustRelativePaths()and invoked it during misc option processing inProjMgrWorker. - Added a focused unit test for
AdjustRelativePaths()plus an end-to-end conversion test covering misc fields at solution/project/layer scopes. - Added new test fixtures (
TestMiscRelativePaths) and a referencecbuild.ymlfor regression validation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/projmgr/src/ProjMgrUtils.cpp | Implements AdjustRelativePaths() for rewriting ./ / ../ fragments in misc option strings. |
| tools/projmgr/include/ProjMgrUtils.h | Declares the new utility function. |
| tools/projmgr/src/ProjMgrWorker.cpp | Applies the new adjustment to all misc option vectors before sequence/relative processing. |
| tools/projmgr/test/src/ProjMgrUtilsUnitTests.cpp | Adds a direct unit test for the new utility behavior. |
| tools/projmgr/test/src/ProjMgrUnitTests.cpp | Adds an integration test validating misc-relative conversion output vs. a reference file. |
| tools/projmgr/test/data/TestMiscRelativePaths/ref/misc-relative.Debug+TEST_TARGET.cbuild.yml | Reference expected cbuild.yml output validating corrected misc paths. |
| tools/projmgr/test/data/TestMiscRelativePaths/misc-relative.csolution.yml | New solution fixture containing misc fields with ./ references. |
| tools/projmgr/test/data/TestMiscRelativePaths/project/misc-relative.cproject.yml | New project fixture containing misc fields with ./ references and a layer reference. |
| tools/projmgr/test/data/TestMiscRelativePaths/layers/misc-relative.clayer.yml | New layer fixture containing misc fields with ./ references and a source file. |
| tools/projmgr/test/data/TestMiscRelativePaths/main.c | Minimal source fixture for the conversion test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 3 files 21 suites 17m 9s ⏱️ Results for commit 220d474. ♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2501 +/- ##
==========================================
- Coverage 65.24% 65.24% -0.01%
==========================================
Files 147 147
Lines 26675 26675
Branches 16166 16164 -2
==========================================
- Hits 17405 17404 -1
Misses 7074 7074
- Partials 2196 2197 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Fixes
Relative paths specified in misc node fields are not adjusted when projects are converted. This causes path references to become invalid in the generated *.cbuild.yml file.
Changes
ProjMgrUtils::AdjustRelativePaths()to detect relative paths (./ or ../) in solution-, project-, and layer-level misc option fields, and adjust the original references across all supported misc node elements.Checklist